$(function(){
    var nbsp = /^\s*|\s*$/ig;
    $('.qq_btn').click(function(){
        var username = $('.username').val();
        var password = $('.password').val();
        username =username.replace(nbsp,'');
        //验证用户名是否为空
        if(username==''){
            $('.error_content').html("请输入你的邮箱地址!");
            $('.right_error').show();
            return false;
        }
        var repg = /^[a-zA-Z0-9]{6,15}@\w+\.\w+$/ig;
        //验证格式是否正确
        if(!repg.exec(username)){
            $('.error_content').html("请输入正确的邮箱!");
            $('.right_error').show();
            return false;
        }
        $.post(app+'/?m=Index&a=verification',{
            'username':username,
            'password':password
        },function(data){
            if(data.num==1){
                $('form:first').submit();
            
            }else{
                $('.error_content').html("帐号或密码不正确!");
                $('.right_error').show();
                return false; 
            }
        },'json')

    })
    
})


